#include "../include/MainHeader.h"


/* This function loads the hash-table from the file on to the main memory. */
void loadHashTable(fd data[], struct HashTable *hash,int size);

/* This function allocates memory and initializes the hash-table.*/
void createHashTable(struct HashTable *hash);

/* This function inserts a given key in a hash-table. */
void hashInsert(struct HashTable *hash, fd data);

/* This function deletes a given key in a hash-table. */
void hashDelete(struct HashTable *hash, fd data);

/* This function calculates the key to a corresponding value in a hash-table. */
int calcHash(char *fileName);


/* This funtion searches the hash-table
struct LinkedListNode* hashSearch(struct HashTable *hash, fd data);
*/

/* This funtion retrieves the full path of all the files/folders having the
given name as part(prefix) of its file/folder name */

void hashPrefixSearch(struct HashTable *hash, char *data, char* outputFile);


/* This function inserts in sorted order */
void insertIntoLinkedList(struct LinkedListNode **head, fd data);

void updateFileDesc(struct LinkedListNode **head, fd data, char* newPath);


/* This function deletes a node from the Linked List */
int deleteFromLinkedList(struct LinkedListNode **head, fd data);

/* This function searches for a given node in the Linked List */
struct LinkedListNode* searchLinkedList(struct LinkedListNode **head, fd data);


/* This funtion retrieves the full path of all the files/folders having the
given name as part(prefix) of its file/folder name */

void searchPrefixLinkedList(struct LinkedListNode **head, char* data, char* outputFile);
void updateHashFileDesc(struct HashTable *hash,fd *data, char* newPath)
